<%@ page language="java" contentType="text/html" pageEncoding="utf-8"%>
<%@ page import="javax.servlet.http.*"%>
<%@ page import="com.orderMgr.bean.*"%>
<%@ page import="java.util.*"%>
<%@page import="org.springframework.context.ApplicationContext"%>
<%@page
	import="org.springframework.context.support.ClassPathXmlApplicationContext"%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@page import="com.orderMgr.biz.*"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<base href="<%=basePath%>">

		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>订餐首页</title>
	<script type="text/javascript">
	function showinfo() {
	var xmlhttp;
	if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp = new XMLHttpRequest();
	} else {// code for IE6, IE5
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange = function() {
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
			document.getElementById("myDiv").innerHTML = xmlhttp.responseText;
		}
	}
	xmlhttp.open("post", "orderInfo.action?restaurantId="
			+ document.getElementById("user.ofName").value, true);
	xmlhttp.send();

}
	</script>


	</head>
	<body>
		<center>
			<table>
				<tr align="center">
					<td>
						<div style="position: absolute; top: 30px; right: 20px; background-color: #69CDFF">
							<%
								if (request.getAttribute("check") != null) {
							%>
							<font color="red">${check}</font>
							<%
								}
							%>
						</div>
						<div align="left" style="width: 150px; height: 20px">
							<%
								if (session.getAttribute("userName") != null) {
							%>

							<%=session.getAttribute("userName")%>
							<a href="usermgr/updatePassword.jsp">修改密码</a>
							<%
								} else {
							%>
							未登录
							<font color="#CE2448" size=4>
							<a href="usermgr/userLogin.jsp">登录</a> 
							<a href="usermgr/register.jsp">注册</a>
							</font>
							<%
								}
							%>
						</div>
					</td>
					<td>
						<table>
							<tr>
								<td rowspan="2" width="30" height="25">
									<img src="<%=basePath%>images/ww.jpg" width="60" height="50">
								</td>
								<td>
									<font>今日点餐</font>
								</td>
							</tr>
							<tr>
								<td>
									<font>吃好每餐，健康每一天</font>
								</td>
							</tr>

						</table>
					</td>
					<td width="600">
						<font color="#CE2448" size=9>上游订餐系统</font>
					</td>
					<td>
						 <div align="right" style="width: 120px; height: 20px">
							<%
								if (session.getAttribute("userPermission") !=null && session.getAttribute("userPermission").equals("1")) {
							%>
						
						 <a href="manager/mananger.jsp">后台管理</a>
						 <font color="#CE2448" size=4>
						 <a	href="cleanSession.action">退出</a>
						</font>
						<%
							}else{
							
							%>
							
						 </div>
						
						<font color="#CE2448" size=4>
						 <a	href="cleanSession.action">退出</a>
						</font>
						<%
						}
						 %>
					</td>
				</tr>

			</table>
			<hr style="color: #F6E5D5">
			<!-- 下面用来放主logo -->
			<table>
				<tr>
					<td
						style=" background-image: url('<%=basePath%>images/dingcanall.jpg');">
						<font color=red face=楷体 size=5><a href="">首页</a>
						</font>
					</td>
					<td
						style=" background-image: url('<%=basePath%>images/dingcanall.jpg')">
						<font color=red face=楷体 size=5><a
							href="getAllFuning.action">每日一笑</a>
						</font>
					</td>
					<td
						style=" background-image: url('<%=basePath%>images/dingcanall.jpg')">
						<font color=red face=楷体 size=5><a
							href="getTodayUserOrderFood.action">今日点餐</a>
						</font>
					</td>
					<td
						style=" background-image: url('<%=basePath%>images/dingcanall.jpg')">
						<font color=red face=楷体 size=5><a
							href="getAllSuggestionLimit.action">用户意见</a>
						</font>
					</td>
				</tr>
			</table>

			<form action="" method="post">
				<table border="0">
					<tr
						style="background-image: url('<%=basePath%>images/dingcanall.jpg'); width: 900pt; height: 35px; ">
						<td colspan="3">
							选择餐厅：
							<%
							List<OfRestaurant> list = (List<OfRestaurant>) request
									.getAttribute("resList");
							for (int i = 0; i < list.size(); i++) {
								OfRestaurant or = list.get(i);
						%>

							<a href="orderInfo.action?restaurantId=<%=or.getOfId()%>"
								style="font-style: " id="restaurantId" onclick="showinfo()"><%=or.getOfName()%></a>

							<%
								}
							%>
						
					</tr>
					
				</table>
			</form>
	<div id="myDiv"></div>
			
		</center>

	</body>
</html>